home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / mus / play / DMODP35b.lha / DASModPlayer / Rexx / MakeList.drx < prev    next >
Text File  |  1994-08-12  |  3KB  |  136 lines

  1. /*
  2.  
  3.    Make Module List, D.A.S ModulePlayer REXX-script for making modulelists!
  4.  
  5.    V0.03 By Erno Tuomainen
  6.    V0.04 By Pauli Porkka
  7.    This version can also save list to a file! You can specify a range which to list! You can also
  8.    specify if you want to list ALL modules or just modules which author are KNOWN or UNKNOWN !
  9.  
  10. */
  11.  
  12. OPTIONS Results
  13. ADDRESS 'DASMP'
  14.  
  15. signal on error
  16. signal on syntax
  17. signal on ioerr
  18. signal on break_c
  19. signal on break_d
  20.  
  21. unknownauthor = 'Unknown'
  22.  
  23. indexwidth = 4
  24. namewidth = 22
  25. authorwidth = 15
  26. stylewidth = 15
  27. timewidth = 6
  28. datewidth = 9
  29.  
  30. MODCOUNT
  31. modcounter=result
  32.  
  33. say ''
  34. say 'Modulelist Generator for D.A.S Moduleplayer, V0.04 by Erno Tuomainen'
  35. say 'Modifications by Pauli Porkka'
  36. say 'You have 'modcounter' modules in your list currently loaded to D.A.S'
  37. call writech(stdout, 'Do you want to list them all (Y/N)? ')
  38. answer = readln(stdin)
  39. answer = upper(answer)
  40. if answer='Y' then do
  41.    startlist = 0
  42.    endlist = modcounter
  43.    END
  44. else DO
  45.    call writech(stdout, 'Enter starting position (0-'modcounter')? ')
  46.    startlist = readln(stdin)
  47.    call writech(stdout, 'Enter ending position ('startlist+1'-'modcounter')? ')
  48.    endlist = readln(stdin)
  49.    END
  50.  
  51. say ''
  52.  
  53. listmode = 'ALL'
  54. call writech(stdout, 'Module list mode, ALL/KNOWN/UNKNOWN (A/K/U)?')
  55. answer = readln(stdin)
  56. answer = upper(answer)
  57. if answer='K' then listmode='KNOWN'
  58. if answer='U' then listmode='UNKNOWN'
  59.  
  60.  
  61. call writech(stdout, 'List to File or Screen (F/S)? ')
  62. answer = readln(stdin)
  63. answer = upper(answer)
  64. if answer='F' then DO
  65.    listfile='YES'
  66.    call writech(stdout, 'Enter pathfilename for the list? ')
  67.    listfilename = readln(stdin)
  68.    END
  69. else
  70.    listfile='NO'
  71.  
  72. listheader1 = left("Num", indexwidth)' 'left("Module name", namewidth)' 'left("Author", authorwidth)' 'left("Style", stylewidth)' 'left("Length", timewidth)' 'left("Date", datewidth)
  73. listheader2 = '---------------------------------------------------------------------------'
  74.  
  75. if listfile='YES' then DO
  76.    call open(listfilehandle, listfilename, 'W')
  77.    call writeln(listfilehandle, listheader1)
  78.    call writeln(listfilehandle, listheader2)
  79.    END
  80. else DO
  81.    say listheader1
  82.    say listheader2
  83.    END
  84.    modulecount=0
  85. DO modspec= startlist to endlist
  86.  
  87.    MOVETO modspec
  88.    GETAUTHOR
  89.    authorspec=result
  90.    printline=0
  91.    if listmode='ALL' then printline=1
  92.  
  93.    if ((listmode='KNOWN') & (authorspec ~= 'Unknown')) then printline = 1
  94.  
  95.    if ((listmode='UNKNOWN') & (authorspec = 'Unknown')) then printline = 1
  96.  
  97.    if printline=1 then DO
  98.       modulecount=modulecount+1
  99.       MODNAME
  100.       namespec=result
  101.       GETSTYLE
  102.       stylespec=result
  103.       GETTIME
  104.       timespec=result
  105.       GETDATE
  106.       datespec=result
  107.  
  108.       moduleline = left(modulecount, indexwidth)' 'left(namespec, namewidth)' 'left(authorspec, authorwidth)' 'left(stylespec, stylewidth)' 'left(timespec, timewidth)' 'left(datespec, datewidth)
  109.  
  110.       if listfile='NO' then DO
  111.          say moduleline
  112.          END
  113.       else
  114.          call writeln(listfilehandle, moduleline)
  115.    END   
  116. END 
  117.  
  118. if listfile='YES' then
  119.    call close(listfilehandle)
  120.  
  121. EXIT
  122.  
  123. error:
  124. syntax:
  125. say 'Error at line 'sigl' in MakeList V0.2'
  126. EXIT
  127.  
  128. break_c:
  129. break_d:
  130. say 'Received a BREAK signal, aborted...'
  131. EXIT
  132.  
  133. ioerr:
  134. say 'I/O Error at line 'sigl
  135. EXIT
  136.